Skip to content

Add reweighting strength option to allow regularized correlated matching - #188

Open
cesar-hernando wants to merge 1 commit into
oscarhiggott:masterfrom
cesar-hernando:regularized-reweighting
Open

cesar-hernando wants to merge 1 commit into
oscarhiggott:masterfrom
cesar-hernando:regularized-reweighting

Conversation

@cesar-hernando

Copy link
Copy Markdown

Adds an optional reweighting_strength argument to Matching.decode, Matching.decode_batch and Matching.decode_to_edges_array, used when enable_correlations=True.

After the first pass, correlated matching gives each edge correlated with a selected edge the probability min(P, 0.5), where P is its conditional probability given the selected edge. With this option it becomes min(reweighting_strength * P, 0.5). Values of reweighting_strength below 1.0 decrease the conditional probabilities and increase the posterior (implied/conditional) weights. The default (1.0) leaves behaviour unchanged: predictions and solution weights are bit-identical to v2.4.0.

The motivation is that, under circuit-level noise, selecting one edge in the first pass discounts several correlated edges at once. The second pass can then select several edges discounted by the same source edge, ignoring the cost of the additional independent faults that their joint occurrence requires. Deep below threshold, correlated matching fails on $(d-1)/2$ faults in a distance-$d$ surface code, losing a unit of effective distance and its advantage over uncorrelated matching. A reweighting_strength below 1.0, calibrated to the (characteristic) physical error rate, restores that advantage; see arXiv:2610.26785.

Example usage:

matching.decode(syndrome, enable_correlations=True, reweighting_strength=0.2)

@haonanren888

Copy link
Copy Markdown

I built and tested the native reweighting_strength implementation at 176534d. On the inputs below, plain matching and s=1 each reproduced the corresponding PyMatching 2.4.0 observable predictions.

Stim 1.17.dev1793242987, surface_code:rotated_memory_z, rounds=d, after_clifford_depolarization=p and decompose_errors=True. Each fault is one flattened DEM error instruction. Pair rows enumerate all 1,906,128 unordered pairs of distinct instructions at each p. The sampled row uses the same 200,000 shots for every decoder (seed 1).

d, p Outcome Plain s=1 s=0.5 s=0.2 s=0.1 s=0.05
3, 0.001 Single-fault failures / 286 0 6 2 0 0 0
5, 0.001 Pair failures 0 1173 633 167 28 4
5, 0.005 Pair failures 0 990 389 76 4 0
5, 0.005 Sampled logical errors 697 527 474 522 603 664

On five noisy TQEC gallery circuits (memory, move_rotation, cnot, three_cnots, steane_encoding), s=0.2 cleared all single-fault failures in four circuits. Memory still had two and cleared at s=0.1. At s=0.1, four circuits had higher observed logical error counts than s=1 on the same 100,000 shots per circuit (seed 20261119). TQEC gallery at 7f76728

The two d=5 cases showed different results at s=0.05. At p=0.005, that strength cleared the enumerated pairs and had a higher sampled logical error count than s=1. These observations cover the listed circuits, noise settings, DEM decompositions and fault weights.

AI disclosure: AI tools ran and checked these experiments at my direction.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants